import http from '@/utils/request'
import {useUserStore} from '@/stores/user'

//获取课程分页数据
export const coachPage = (pageQueryParams: any) => {
  return http.request({
    url: '/api/v1/front/coach/page',
    method: 'get',
    params: pageQueryParams,
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

//获取课程预约分页数据
export const courseReservePage = (pageQueryParams: any) => {
  return http.request({
    url: '/api/v1/front/profile/myCourseReserve',
    method: 'get',
    params: pageQueryParams,
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

/**
 * 教练评论列表
 * @param params
 */
export const coachCommentsPage = (params: any) => {
  return http.request({
    url: '/api/v1/front/coach-comment/page',
    method: 'get',
    params: params,
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

/**
 * 教练添加评论
 * @param data
 */
export const addCoachComment = (data: any) => {
  return http.request({
    url: '/api/v1/front/coach-comment/add',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

/**
 * 获取教练信息
 * @param params
 */
export const coachDetail = (params: any) => {
  return http.request({
    url: '/api/v1/front/coach/getCoach',
    method: 'get',
    params: params,
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

/**
 * 获取教练关联的教学安排课程
 * @param params
 */
export const getCoachScheduleCourses = (params: any) => {
  return http.request({
    url: '/api/v1/front/coach/scheduleCourses',
    method: 'get',
    params: params,
    headers: {
      'Content-Type': 'application/json'
    }
  })
}
